<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>
    <script type="text/javascript" src="js/cookie.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .laytable-cell-1-0-1 {
            height: auto;
            line-height: 28px;
            /*position: relative;*/
            /*text-overflow: ellipsis;*/
            /*white-space: nowrap;*/
            /*box-sizing: border-box;*/
            /*padding: 0px 15px;*/
            /*overflow: hidden;*/
        }
    </style>
</head>

<body>
<div class="x-body">
    <!-- 表格 -->
    <table id="table_id" lay-filter="dev"></table>

</div>
<script type="text/html" id="scoreTpl">
    {{# if(d.orderItemScore==0){ }}
        {{d.orderItemScore}}--不喜欢
    {{# }else if(d.orderItemScore==1){ }}
        {{d.orderItemScore}}--默认
    {{# }else if(d.orderItemScore==2){ }}
        {{d.orderItemScore}}--喜欢
    {{# } }}
</script>

<script>
    layui.use('table', function (table) {
        // 表格数据加载
        var tableIns = table.render({
            id: 'layui_table_id',
            elem: '#table_id',
            toolbar: '#th_toolbar',
            defaultToolbar: ['filter', 'print'],
            // height: 320,
            url: '/sell/showOrderDetail',
            cols: [
                [
                    {
                        field: 'foodName',
                        title: '菜名'
                    },
                    {
                        field: 'foodImage',
                        title: '图片',
                        templet: '<div><img src="{{d.foodImage}}" alt="{{d.foodImage}}" style="width: 6.25rem;height: 6.25rem;"/></div>'
                    },
                    {
                        field: 'orderItemCount',
                        title: '购买数量'
                    },
                    {
                        field: 'orderItemCost',
                        title: '小计',
                        templet:'<span>￥{{d.orderItemCost.toFixed(2)}}</span>'
                    },
                    {
                        field:'orderItemScore',
                        title:'评分',
                        templet:'#scoreTpl'
                    }
                ]
            ]
        });

    });

</script>

</body>

</html>
